﻿
    
    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <BooleanToVisibilityConverter x:Key="boolToVis" />   

    <!-- COLORS /////////////////////////////////////////////////////////////////-->
    <!--<Color x:Key="WindowColor">#FFE8EDF9</Color>-->

    <Color x:Key="WindowColor">#FF324f89</Color>
    <Color x:Key="MainTextColor">White</Color>
    <Color x:Key="ContentAreaColorLight">#FFC5CBF9</Color>
    <Color x:Key="ContentAreaColorDark">#FF7381F9</Color>
    <Color x:Key="DisabledControlLightColor">#FFE8EDF9</Color>
    <Color x:Key="DisabledControlDarkColor">#FFC5CBF9</Color>
    <Color x:Key="DisabledForegroundColor">#FF888888</Color>
    <Color x:Key="SelectedBackgroundColor">#FFC5CBF9</Color>
    <Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>
    <Color x:Key="ControlLightColor">LightGray</Color>
    <Color x:Key="ControlMediumColor">Gray</Color>
    <Color x:Key="ControlDarkColor">DarkGray</Color>
    <Color x:Key="ControlMouseOverColor">#3843C4</Color>
    <Color x:Key="ControlPressedColor">#211AA9</Color>
    <Color x:Key="GlyphColor">#FF444444</Color>
    <Color x:Key="GlyphMouseOver">sc#1, 0.004391443, 0.002428215, 0.242281124</Color>

   
    <!-- CHECKBOX /////////////////////////////////////////////////////////////////-->
    <Style x:Key="{x:Type CheckBox}"
       TargetType="{x:Type CheckBox}">
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Border x:Name="Border" Width="13" Height="13" CornerRadius="2" BorderThickness="1">
                                <Border.BorderBrush>
                                    <SolidColorBrush Color="DarkGray" />                                  
                                </Border.BorderBrush>    
                                <Border.Background>
                                    <SolidColorBrush Color="LightGray"/>
                                </Border.Background>
                                <Grid>
                                    <Path Visibility="Collapsed" Width="7" Height="7" x:Name="CheckMark" SnapsToDevicePixels="False" StrokeThickness="2" Data="M 0 0 L 7 7 M 0 7 L 7 0">
                                        <Path.Stroke>
                                            <SolidColorBrush Color="#FF444444" />
                                        </Path.Stroke>
                                    </Path>
                                    <Path Visibility="Collapsed" Width="7" Height="7" x:Name="InderminateMark" SnapsToDevicePixels="False" StrokeThickness="2" Data="M 0 7 L 7 0">
                                        <Path.Stroke>
                                            <SolidColorBrush Color="#FF444444" />
                                        </Path.Stroke>
                                    </Path>
                                </Grid>
                            </Border>
                        </BulletDecorator.Bullet>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />                                
                                <VisualState x:Name="Pressed" />                                                                   
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="CheckMark">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="InderminateMark">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter Margin="4,0,0,0"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Left"
                            RecognizesAccessKey="True" />
                    </BulletDecorator>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MyFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Control}">
                    <Grid Margin="3 2">
                        <Rectangle Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2"/>
                        <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"  CornerRadius="2" BorderThickness="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ShadowStyle">
        <Setter Property="Control.Foreground" Value="LightGray" />
    </Style>

    <!-- BUTTONS /////////////////////////////////////////////////////////////////-->
    
    <Style TargetType="Button" x:Key="CmdButtonTransparent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <StackPanel Width="{TemplateBinding Width}" Height="{TemplateBinding Width}" x:Name="panel">
                        <ContentPresenter Width="{TemplateBinding Width}" Height="{TemplateBinding Width}" />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>   
    

    <!-- LISTS /////////////////////////////////////////////////////////////////-->

    <DataTemplate x:Key="checkboxCell">
        <StackPanel Orientation="Horizontal">
            <CheckBox Name="chk1" IsChecked="{Binding Path=IsSelected}"/>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="ArtistCell">
        <TextBlock Text="{Binding Artist}" x:Name="text" VerticalAlignment="Center" Grid.Column="1" >
            </TextBlock>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=Dirty, Mode=OneWay}" Value="True">
                <Setter TargetName="text" Property="FontWeight" Value="Bold"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate x:Key="TitleCell">
        <TextBlock Text="{Binding Title}" x:Name="text" VerticalAlignment="Center" Grid.Column="1">
            </TextBlock>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=Dirty, Mode=OneWay}" Value="True">
                <Setter TargetName="text" Property="FontWeight" Value="Bold"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate x:Key="AlbumCell">

        <TextBlock Text="{Binding AlbumName}" x:Name="text" VerticalAlignment="Center" Grid.Column="1" >
            </TextBlock>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=Dirty, Mode=OneWay}" Value="True">
                <Setter TargetName="text" Property="FontWeight" Value="Bold"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate x:Key="GenreCell">
        <TextBlock Text="{Binding Genre}" x:Name="text" VerticalAlignment="Center" Grid.Column="1" >
            </TextBlock>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=Dirty, Mode=OneWay}" Value="True">
                <Setter TargetName="text" Property="FontWeight" Value="Bold"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate x:Key="DisplayStringCell">
        <TextBlock Text="{Binding DisplayString}" x:Name="text" VerticalAlignment="Center" Grid.Column="1">
        </TextBlock>        
    </DataTemplate>
    
    <DataTemplate x:Key="FileNameCell">     
            <TextBlock Text="{Binding FileName}" VerticalAlignment="Center" Grid.Column="1" >
                 <!--<TextBlock.ToolTip>
                    <Image Source="{Binding Path=ImageBitmap}" Width="70" Height="70"></Image>
                </TextBlock.ToolTip>-->
            </TextBlock>       
    </DataTemplate>  
    
    <DataTemplate x:Key="hasCoverCell">
        <StackPanel>
            <Rectangle Width="15" Height="15" x:Name="rect">
               <!--- Empty icon -->
            </Rectangle>
        </StackPanel>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=HasCover, Mode=OneWay}" Value="True">
                <Setter TargetName="rect" Property="Fill">
                    <Setter.Value>
                        <VisualBrush Stretch="Fill"  Visual="{StaticResource appbar_check}" />
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

</ResourceDictionary>